-- GENERATED SPELL FOR [Skulking Witch] --


function spell0_20882(pUnit, Event) --@Chastise,n/a--
pUnit:FullCastSpellOnTarget(36863,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20882', 0, 1)
end

function spell1_20882(pUnit, Event) --@Chastise,n/a--
pUnit:FullCastSpellOnTarget(38851,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20882', 0, 1)
end

function spell2_20882(pUnit, Event) --@Gouge,n/a--
pUnit:FullCastSpellOnTarget(36862,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20882', 4345, 1)
end

function spell3_20882(pUnit, Event) --@Greater Invisibility,Self--
pUnit:FullCastSpellOnTarget(16380,pUnit)
pUnit:RegisterEvent('Sorts_20882', 555, 1)
end

function spell4_20882(pUnit, Event) --@Lash of Pain,n/a--
pUnit:FullCastSpellOnTarget(36864,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20882', 657, 1)
end

function spell5_20882(pUnit, Event) --@Lash of Pain,n/a--
pUnit:FullCastSpellOnTarget(38852,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20882', 645, 1)
end

function Sorts_20882(pUnit, Event)
local choix_sorts_20882 = math.random(0, 5)
if choix_sorts_20882 == 0 then
pUnit:RegisterEvent('spell0_20882', 1, 1)
end
if choix_sorts_20882 == 1 then
pUnit:RegisterEvent('spell1_20882', 1, 1)
end
if choix_sorts_20882 == 2 then
pUnit:RegisterEvent('spell2_20882', 1, 1)
end
if choix_sorts_20882 == 3 then
pUnit:RegisterEvent('spell3_20882', 1, 1)
end
if choix_sorts_20882 == 4 then
pUnit:RegisterEvent('spell4_20882', 1, 1)
end
if choix_sorts_20882 == 5 then
pUnit:RegisterEvent('spell5_20882', 1, 1)
end
end

function mob20882_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_20882', math.random(1500, 3000), 1)
end

function mob20882_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20882_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20882_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(20882, 1, 'mob20882_Action')
RegisterUnitEvent(20882, 2, 'mob20882_Leave')
RegisterUnitEvent(20882, 3, 'mob20882_Kill')
RegisterUnitEvent(20882, 4, 'mob20882_Die')
